﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gl_mes.DAL.MesDB
{
    [Table("line_real")]
    [Serializable]
    public class LineReal
    {
        /// <summary>
        /// ID，主键，自增长
        /// </summary>
        [Column("id")]
        [Key]
        [Required]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int ID { get; set; }

        /// <summary>
        /// 生产线ID
        /// </summary>
        [Column("line_id")]
        [Required]
        public int LineID { get; set; }

        /// <summary>
        /// 生产线代号
        /// </summary>
        [Column("line_code")]
        [Required]
        [MaxLength(20)]
        public string LineCode { get; set; }

        /// <summary>
        /// 生产线名称
        /// </summary>
        [Column("line_name")]
        [Required]
        [MaxLength(20)]
        public string LineName { get; set; }

        /// <summary>
        /// 生产线组别名
        /// </summary>
        [Column("cal_group_name")]
        [Required]
        [MaxLength(20)]
        public string CalGroupName { get; set; }

        /// <summary>
        /// 考勤日期
        /// </summary>
        [Column("fill_date")]
        [Required]
        public DateTime FillDate { get; set; }

        /// <summary>
        /// 出勤总人数
        /// </summary>
        [Column("real_empl_qty")]
        [Required]
        public int RealEmplQty { get; set; }

        /// <summary>
        /// 实际作业总工时，以分钟计算
        /// </summary>
        [Column("real_work_time")]
        [Required]
        public decimal RealWorkTime { get; set; }

        /// <summary>
        /// 实际总产量
        /// </summary>
        [Column("real_total_upph")]
        [Required]
        public decimal RealTotalUpph { get; set; }

        /// <summary>
        /// 有效工时，以分钟计算，实际产量 / 预计人数 / 预计upph
        /// </summary>
        [Column("enared_work_time")]
        [Required]
        public decimal EnaredWorkTime { get; set; }

        /// <summary>
        /// 缺失工时，以分钟计算，标准工时 - 有效工时
        /// </summary>
        [Column("loss_work_time")]
        [Required]
        public decimal LossWorkTime { get; set; }


        /// <summary>
        /// 建档人
        /// </summary>
        [Column("create_user"), MaxLength(20)]
        public string CreateUser { get; set; }

        /// <summary>
        /// 建档日期
        /// </summary>
        [Column("create_date")]
        public DateTime? CreateDate { get; set; }

        /// <summary>
        /// 更改人
        /// </summary>
        [Column("update_user"), MaxLength(20)]
        public string UpdateUser { get; set; }

        /// <summary>
        /// 更改日期
        /// </summary>
        [Column("update_date")]
        public DateTime? UpdateDate { get; set; }
    }
}
